﻿using System;
using System.Collections.Generic;
using System.Text;

namespace hoemwork
{
    class Mimic
    {   //不使用string自带的Join()方法，定义一个mimicJoin()方法，能将若干字符串用指定的分隔符连接起来，
        //比如：mimicJoin("-","a","b","c","d")，其运行结果为：a-b-c-d
        public static void MimicJoin( string separator, params string[] parameter)
        {
           
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < parameter.Length; i++)
            {
                if (i== parameter.Length-1)
                {
                    separator = null;
                }
                sb = sb.Append(parameter[i]).Append(separator);

            }
            Console.WriteLine(sb);
        }
    }


}


